1. Field of the Invention
The present invention relates to an image measuring device and a program measuring a shape of a measurable object without contact, based on an image obtained by capturing the image of the measured object.
2. Description of Related Art
The image measuring device is a device capturing an image of a measured object (hereafter referred to as a “work piece”); analyzing the image; extracting a shape such as a straight line, circle, polygon and the like; and obtaining measurement results such as distance, inclination, diameter, width, and the like of the extracted shape.
The work piece comes in various sizes and when measuring a work piece which fails to fit in an image field of view in a single image capture, a field of view expansion method (referred to as “image stitching”) is generally used. The image stitching method captures a plurality of partial images covering an entire work piece and creates a single, total image by pasting together the plurality of partial images (See Japanese Patent Laid-open Publication No. 2011-185888).
FIG. 7A is a schematic view of an image measuring device performing image stitching. The image measuring device includes a stage 100 on which a work piece W is placed; an image capturer 124 (an area sensor) having an image capture region and capturing an image of the work piece W; a displacer relatively displacing the stage 100 and the image capturer 124; a controller capturing a plurality of partial images with the image capturer 124 while displacing the image capturer 124 to the work piece W at a fixed speed with the displacer; a position acquirer obtaining a position where the image capturer 124 captures the image; a total image former forming the total image by pasting together the plurality of partial images based on the position data obtained by the position acquirer; and a light source 126 integrally displacing with the image capturer 124 and emitting light at a portion of the work piece W captured by the image capturer 124.
As a conventional image stitching method, the two methods described below are known, for example. Both methods have in common that the entire work piece is divided into a plurality of regions in a matrix and an image of each region is captured, after which the total image of the work piece is formed by pasting together the plurality of obtained partial images.
A first method repeats a sequence of relative displacement of the image capturer 124→a pause→capture image of the work piece W→relative displacement. In other words, the image capturer 124 is displaced to a first region #1 of the work piece W, then is paused, and captures the image. Next, the image capturer 124 is displaced to a subsequent region #2 of the work piece W, then is paused, and captures the image. By repeating the sequence in regions #3, #4, #5, and so on, respective partial images for a plurality of regions configuring the entire work piece W are obtained. By pasting together each of the captured partial images based on the respective position data, pixel size and the like, a single total image is formed. The position data for each of the partial images is obtained as a position coordinate of the stage 100 and the image capturer 124 every time the stage 100 is paused. In the first method, for example, exposure time of the image capturer 124 is set at 1/12 seconds and ROI (Region Of Interest) is set at full pixel reading (such as 2048×1536). FIG. 7B is an exemplary case where nine regions (3×3) of the work piece W captured by the image capturer 124 are sequentially captured using the first method and are pasted together.
A second method successively captures images of the work piece W when passing each of the regions while displacing the image capturer 124 relative to the work piece W. In other words, while displacing the image capturer 124 at the fixed speed, the image capturer 124 captures the image using an extremely short exposure time from a strobe light, for example, when passing each of the regions and obtains respective partial images of the plurality of regions configuring the entire work piece W. Capturing images while displacing is performed for each region in the same row, and is paused at a region (at both ends of a row) where the image capturer 124 transfers to a second row, then resumes. FIG. 7C is an exemplary case where the nine regions (3×3) of the work piece W captured by the image capturer 124 are sequentially captured using the second method and are pasted together. In this case, after capturing the image of the region #1, the image capturer 124 starts displacing. When transiting the region #2, the image capturer 124 captures the image of the region #2, stops displacement in the region #3, and captures the image of the region #3. When image capture of the first row ends in this way, the image capturer 124 is displaced to the region #4, which is adjacent to the region #3 in the second row. Similar to the first row, image capture is performed respectively from the region #4 to the region #6 in the second row. When capturing images in the first and second rows ends in this way, the image capturer 124 is displaced to the region #7, which is adjacent to the region #6 in a third row. Similar to the first and second rows, image capture is performed sequentially from the region #7 to the region #9 in the third row. Each of the captured partial images is pasted together in the same way as the first method to form a single total image. The position data of respective partial images is obtained as the position coordinates of the stage 100 and the image capturer 124 at the time of a trigger that is output every time an image is captured using the image capturer 124. In the second method, image capture is performed while displacing, and therefore, the exposure time of the image capturer 124 is set short, such as 1/300 to 1/600 seconds. On the other hand, ROI of the image capturer 124 is set with the full pixel reading similar to the first method (such as 2048×1536).
In the first method described above in the background art, capturing images may take an excessive amount of time compared to a case where there is no acceleration/deceleration or pausing. In addition, pasting accuracy may be reduced when a device behavior becomes unstable. The second method requires an expensive strobe light capable of emitting high intensity light momentarily on an area having a certain breadth, and therefore an extra cost for the device is incurred. Further, both methods form the single total image by pasting together a plurality of partial images in the matrix of the total image, however, as shown in FIGS. 7B and 7C, brightness of each partial image may be non-uniform at an image center portion close to a center of illumination and an image peripheral portion far from the center of illumination. In addition, due to distortion of a lens, borders and offset may occur where the partial images are pasted together. Therefore, two-dimensional captured images need to be corrected and then pasted together; however, correction errors tend to occur during that time. In addition, when each of the partial images is pasted together, an overlap margin to allow adjusting between adjacent images is required on four sides of the image and therefore, image capture efficiency is not good because a total image area is increased.